package br.com.estevam.sisfin.base;

import org.apache.tapestry5.Asset;
import org.apache.tapestry5.annotations.Path;
import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.SessionState;
import org.apache.tapestry5.ioc.annotations.Inject;

import br.com.estevam.sisfin.data.Visit;
import br.com.estevam.sisfin.pages.Index;

public class DefaultPage {

	@SessionState
	private Visit visit;
	
	@Persist("flash")
	private String msg;
	
	@Inject
	@Path("context:layout/images/default/delete.gif")
	private Asset deleteImage;
	
	@Inject
	@Path("context:layout/images/default/edit.gif")
	private Asset editImage;
	
	Class<?> onActivate(){
		if(visit.getId() == -1){
			return Index.class;
		}
		return null;
	}

	public String getMsg(){
		return msg;
	}

	public void setMsg(String msg){
		this.msg = msg;
	}

	public Visit getVisit() {
		return visit;
	}

	public void setVisit(Visit visit) {
		this.visit = visit;
	}

	public Asset getDeleteImage() {
		return deleteImage;
	}
	
	public Asset getEditImage() {
		return editImage;
	}

}
